package edu.xlh.travel.websocket.dao;

import edu.xlh.travel.websocket.domin.EmpInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface EmpInfoDao extends JpaRepository<EmpInfo,String>, JpaSpecificationExecutor<EmpInfo> {

    @Transactional
    @Modifying
    @Query(value = "update EmpInfo set username =?2 where id =?1")
    int updateEmpInfoByUserId(String userId , String userName);
}
